MPEG audio/video decoder

ABSTRACT

An MPEG audio/video decoder has memories, a signal processing unit (SPU) including a multiplier and a butterfly unit, a main CPU, and a memory controller which are time division multiplexed between decoding video and audio data. For audio decoding, the butterfly unit determines combinations of components of a frequency-domain vector to reduce the number of multiplies required to transform to the time domain (matrixing). Matrixing is interwoven with MPEG filtering to increases throughput of the decoder by increasing parallel use of the multiplier, the butterfly unit, and a memory controller. The decoder includes a degrouping circuit which performs two divisions in three clock cycles to degroup a subband code. Three cycles matches the write time of three components so that subband codes are degrouped and written to memory with a minimum delay. Performing two divides in three clock cycles allows the divider to be smaller. In response to an error signal from a source of an MPEG audio data stream, the decoder replaces data with an error code and temporarily enables error handling. The error code is a valid bit combination rarely found in MPEG audio data frames. During audio decoding with error handling enabled, the decoder checks for the error code and replaces the error code with reconstructed data. Typically, some subband data are replaced with zeros so that an error only changes some of the frequency components.

CROSSREFFERENCE TO RELATED APPLICATION

This is a continuation-in-part of U.S. patent application Ser. No.08/288,652 entitled "A Variable Length Code Decoder for VideoDecompression Operations," filed Aug. 10, 1994 now abandoned, which is acontinuation of U.S. patent application Ser. No. 07/890,732, filed May28, 1992 (now abandoned) which was a continuation-in-part of U.S. patentapplication Ser. No. 07/669,818, entitled "Decompression Processor forVideo Applications," filed Mar. 15, 1991 (now abandoned), all of whichare incorporated by reference in their entirety.

COPYRIGHT NOTICE

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patent documentor the patent disclosure, as it appears in the Patent and TrademarkOffice patent files or records, but otherwise reserves all copyrightrights whatsoever.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to decoders for generating audio signals fromdigital data, and in particular to combined audio and video decodingaccording to the MPEG standard.

DESCRIPTION OF RELATED ART

The Motion Picture Experts Group (MPEG) developed an internationalstandard (sometimes referred to herein as the "MPEG standard") forrepresentation, compression, and decompression of motion pictures andassociated audio on digital media. The International StandardsOrganization (ISO) publication, No. ISO/IEC 11172:1993 (E), entitled"Coding for Moving Pictures and Associated Audio--for digital storagemedia at up to about 1.5 Mbit/s," describes the MPEG standard and isincorporated by reference herein in its entirety. The MPEG standardspecifies coded digital representations of audio and video and isintended for continuous data transfer from equipment such as compactdisks, digital audio tapes, or magnetic hard disks, at rates up to 1.5Mbits per second.

Under the MPEG standard, parallel data streams or time multiplexed datastreams provide video data frames and audio data frames. Methods andsystems for decompressing video data frames are described in U.S. patentapplications Ser. Nos. 07/890,732 and 07/669,818 which were incorporatedby reference above. Audio data frames contain a header, sideinformation, and subband data. Subband data indicate frequency-domainvectors that are converted to time-domain output sound amplitudes by atransformation (matrixing) and a smoothing filter (windowing).

Typically, MPEG audio/video decoding systems for decoding digital datainclude, two decoders, one for audio decoding and one for videodecoding, on two separate integrated circuit chips. The audio decoderand video decoder are separated because of the differences between MPEGaudio coding techniques and MPEG video coding techniques, but separateaudio and video decoders increase the amount of circuitry in and thecost of an audio/video decoding system. A decoding architecture isneeded that reduces the amount of circuitry and the cost of decodingMPEG audio and video data.

SUMMARY OF THE INVENTION

In accordance with this invention, an MPEG audio/video decoderintegrated on a single chip uses components such as memories, a mainCPU, a memory controller, and a signal processing unit (SPU) for bothaudio and video decoding. The SPU contains a multiplier (ormultiply-and-accumulate unit) and a butterfly unit which togetheralternately decode video data and audio data. The combination of amultiplier and a butterfly unit is efficient for both audio and videodecoding. In particular, for audio decoding, determining particular sumsand differences of the components of a frequency-domain vector with abutterfly unit reduces the number of multiplies required for matrixing(i.e. determining a component of a time-domain vector from afrequency-domain sample vector). Determining combinations of thecomponents can be performed in series with dequantizing and descaling ofthe components combined. Additionally, matrixing and windowing (i.e.combining a present time-domain vectors with previous time-domainvectors) are combined in a single instruction to increase throughput ofa decoder by increasing parallel use of the multiplier, the butterflyunit, and a memory controller which reads and writes to an externalmemory.

Also in accordance with this invention, a degrouping circuit fordecoding MPEG standard subband codes includes a divider which uses threeclock cycles to perform two divisions which convert a MPEG subband codeinto three vector components. Performing two divides in three clockcycles instead of two allows the divider to be smaller and less costly,but does not slow decoding because three clock cycles is the timerequired to write three vector components into a single-port memory.Accordingly, the smaller divider does not significantly increase thetime required to degroup subband codes and write the resultingcomponents into memory. Using the known limits on input dividends of thedivider, the size and cost of the divider can be further reduced fromthat of a general purpose divider.

Also in accordance with this invention, in response to an error signalfrom an external source of an MPEG audio data stream, an MPEG audiodecoder replaces errors in the audio data stream with an error codewhich is a bit combination rarely found in MPEG audio data frames, andthen temporarily enables error handling. The audio data streamcontaining error codes can be saved or buffered in the decoder. Duringaudio decoding with error handling enabled, the decoder checks the audiodata for the bit combination equaling the error code and replaces thebit combination with reconstructed data. The replacement attempts tominimize the audible effects of an error. Typically, some subband datais replaced with zeros so that an error causes some of the frequencycomponents to be lost.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a block diagram of an MPEG audio/video decoder inaccordance with an embodiment of this invention.

FIG. 2 shows a block diagram of a degrouping circuit in accordance withan embodiment of this invention.

FIGS. 3A, 3B, and 3C show a block diagram, a logic table, and a gatelevel diagram of a divide-by-three circuit in accordance with thisinvention.

FIGS. 4A, 4B, and 4C show a block diagram, a logic table, and a gatelevel diagram of a divide-by-five circuit in accordance with thisinvention.

FIGS. 5A and 5B show a block diagram of another embodiment of thedegrouping circuit and a gate level diagram of an address generator fordividing by three, five, or nine in accordance with this invention.

FIG. 6 shows memory maps of previous vector components used during awindowing process in

FIGS. 7A, 7B, and 7C show a block diagram of an embodiment of a signalprocessing unit in accordance with an embodiment of this invention.

FIG. 8A shows a flow diagram of an audio decoding process in accordancewith this invention.

FIG. 8B shows a timing diagram for the process of FIG. 8A.

Use of the same reference symbols in different figures indicates similaror identical elements.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

In accordance with this invention, an audio/video decoder decodes MPEGstandard data streams to provide an audio signal and a video signal. Theaudio/video decoder alternates between decoding video data frames anddecoding audio data frames and employs the same memories and signalprocessing unit (SPU) for both audio and video decoding.

FIG. 1 shows a block diagram of an audio/video decoder 100 for decodingMPEG standard audio and video data frames. Decoder 100 receives MPEGstandard coded audio and video data via a serial bus 104, decodes theaudio and video data, and provides the decoded data over a video bus 176and an audio bus 192. Decoder 100 includes static random access memories(SRAMs) 134 to 137 (also referred to herein as ZMEM 134, QMEM 135, TMEM136, and PMEM 137) which alternate between holding video data for videodecoding and holding audio data for audio decoding, and a signalprocessing unit (SPU) 140 which includes an instruction memory, aregister file, a multiplier or a multiply-and-accumulate unit (MAC), anda butterfly unit for decoding and decompressing video data or audio datadepending on whether decoder 100 is currently decoding video or audio.

Audio/video decoder 100 interfaces with a source of audio and videosignals such as a host computer and a compact disk digital signalprocessor (CD-DSP) over a host bus 102 and serial bus 104. Serial bus104 carries a stream of compressed audio and video data following theMPEG standard, which decoder 100 receives through a first-in-first-out(FIFO) buffer 115 ("code FIFO 115"). A memory controller 180 reads thecompressed data from code FIFO 115 via a main bus 155 and writes thecompressed data to an external memory 160 (also referred herein as DRAM160). As disclosed below, an audio error code injector 118 can injecterror codes into audio data written to DRAM 160. A central processingunit (CPU) 150, which is a microcoded processor having its owninstruction memory controls access to main bus 155 and in particular,sends commands to memory controller 180 which cause the data transferfrom code FIFO 115 to DRAM 160.

In this embodiment, DRAM 160 contains dynamic random access memory(DRAM) components. Other suitable memory technologies can also be used.DRAM 160 holds compressed data from serial bus 104 and decompressed datafor output to an audio bus 192 or a video bus 176. Under the directionof CPU 150, memory controller 180 transfers compressed audio or videodata to a decoder FIFO 125 for decoding of an audio data frame or avideo data frame by SPU 140.

According to the MPEG standard, a video data frame is a compresseddigital description of a picture and an audio data frame is a digitaldescription of a fixed number of frequency-domain sound samples in up totwo sound channels. The MPEG standard for video data frames and decodingof video data frames to produce a video signal are described in U.S.patent applications Ser. Nos. 07/890,732 and 07/669,818 which wereincorporated by reference above. The MPEG standard currently definesthree types of audio data frames referred to as layer 1, layer 2, andlayer 3 data frames. Decoder 100 in FIG. 1 decodes layer 1 and layer 2audio data frames. Layer 1 and layer 2 audio data frames contain aheader, side information, and subband data. The header indicates: thebitrate of the data stream providing the audio data frames; the samplefrequency of the decoded sound; whether the subband data contains one ortwo sound channels; and a mode extension describing whether the soundchannels in the subband data are independent, stereo, or intensitystereo. The side information indicates the number of bits allocated persubband in the subband data and an index to scalefactors F fordequantizing and descaling subband data as described below.

CPU 150 controls the percentage of time SPU 140 spends decoding audiodata. For audio decoding, CPU 150 directs memory controller 180 to moveaudio data from DRAM 160 to decoder FIFO 125 and directs SPU 140 performthe calculations necessary for decoding audio data. SPU 140 operates inparallel with CPU 150 and executes commands according to software storedin an instruction memory in SPU 140.

When decoding an audio data frame, SPU 140 first executes a "get bits"command which loads the header and side information of the audio dataframe, from decoder FIFO buffer 125, through a VLC/FLC decoder 120, intoCPU 150. The CPU 150 writes bit allocations and scalefactors from theside information through SPU 140, into QMEM 135. Header and sideinformation pass through VLC/FLC decoder 120 unchanged. Subband datafollows the side information in the data stream from decoder FIFO buffer125. VLC/FLC decoder 120 contains circuits for decoding variable lengthcodes (VLC) in video data and fixed length codes (FLC) in audio andvideo data. VLC/FLC decoder 120 also contains degrouping circuits foraudio data as described below.

A "get subbands" command executed by SPU 140 causes VLC/FLC decoder 120to parse and convert subband codes Ci from decoder FIFO buffer 125 into192 scaled and quantized components Si". VLC/FLC decoder 120 preformsdegrouping as required and writes the scaled and quantized componentsSi" into ZMEM 134. Each frequency-domain vector S" has 32 components Si"in 32 frequency ranges (subbands i). The "get subbands" command writescomponents Si" for three frequency-domain vector S" in each channel (sixvectors S" total for two channels) to ZMEM 134. For intensity stereo,some of the frequency components Si" are used by both channels. VLC/FLCdecoder 120 writes two copies of components that are shared by thechannels so that each vector S" in ZMEM 134 has 32 components Si". Formonophonic sound, VLC/FLC decoder 120 can write two copies of allcomponents Si" so that both channels of a stereo output signal are thesame. The number of vectors S" in an audio data frame depends on thenumber of channels and whether the audio data frame follows layer 1 orlayer 2 of the MPEG standard. Under layer 1, there are 12 vectors S"(384 samples) per channel. Under layer 2, there are 36 vectors S" (1152samples) per channel.

SPU 140 executes a "dequant/descale" command to generate components Siof frequency-domain vectors S by descaling and dequantizing values Si"from ZMEM 134. SPU 140 writes a representation of a vector S to aportion of TMEM 136. Matrixing as described below transforms afrequency-domain vector S to a time-domain vector V. SPU 140 storescomponents Vi of a time-domain vector V in PMEM 137, and memorycontroller 180 writes components Vi from PMEM 137 to DRAM 160.Components from 16 consecutive time-domain vectors V⁰ to V¹⁶ from DRAM160 are combined in a windowing process described below, and thecombination is accumulated in TMEM 136 to provide 32 time-domain outputsound amplitudes Ai. Time-domain output sound amplitudes Ai aretypically written to an audio output FIFO buffer in DRAM 160, andwritten as required from DRAM 160 through main bus 155, an output audioFIFO 190, and an audio serializer 191 to audio output bus 192. Outputaudio FIFO buffer 190 holds enough output sound amplitude values so thatat the fastest sampling rate expected delayed access to main bus 155does not interrupt sound. Audio serializer 191 converts the output audiodata to a serial data stream, and a digital-to-analog converter (DAC)and amplifier (not shown) generate a sound from the audio data.

The side information indicates the number of possible values for eachquantized component Si" (and each subband code Ci) in a subband i. Forexample, if subband codes Ci in subband i have 0, 2, 4, . . . , or 2^(N)possible values, then 0, 1, 2, . . . , or N bits are used for each codeCi. If no bits are used for a subband i, VLC/FLC decoder 120 writes zerointo ZMEM 134 for components Si", and vector S has less than 32 non-zerocomponents. For a bit allocation representing 2^(N) possible values fora subband i, VLC/FLC decoder 120 uses the bit allocations from the sideinformation in QMEM 135 to identify the start and end of a component Si"in the data stream and writes component Si" to a word aligned locationin ZMEM 134.

The MPEG standard allows components Si" to have 3, 5, or 9 possiblevalues and encodes three components S1i", S2i", and S3i" from subband iof three different vectors S1, S2, and S3 into a single code Ci. Forexample, there are 27 possible combinations of three quantized andscaled components S1i", S2i", and S3i", if each has three possiblevalues 0, 1, or 2. A 5-bit subband code Ci given by eq. 1 represents the27 possible combinations.

    Ci=3.sup.2 ·S3i"+3·S2i"+S1i"             (eq. 1)

Similarly, a 7-bit code Ci given by eq. 2 represents three componentsS1i", S2i", and S3i" having five possible values 0 to 4 each.

    Ci=5.sup.2 ·S3i"+5·S2i"+S1i"             (eq. 2)

Eq. 3 gives a 10-bits code Ci representing three components S1i", S2i",and S3i" which each have 9 possible values, 0 to 8.

    Ci=9.sup.2 ·S3i"+9·S2i"+S1i"             (eq. 3)

VLC/FLC decoder 120 degroups a code Ci into three components S3i", S2i",and S1i" given by eqs. 1 to 3 before writing the scaled and quantizedcomponents S3i", S2i" and S1i" to ZMEM 134. Two divisions are sufficientto degroup a code Ci given by eqs. 1 to 3. For example, if Ci=x²·S3i"+x·S2i"+S1i" and components S3i", S2i" and S1i" are less than x,dividing Ci by x provides a quotient Q1 and a remainder R1 given by eq.4.

    Ci/x)=Q1=x·S3i"+S2i" with remainder R1=S1i"       (eq. 4)

Dividing by x again provides a quotient Q2 and a remainder R2 given byeq. 5.

    (Q1/x)=Q2=S3i" with remainder R2=S2i"                      (eq. 5)

If ZMEM 134 has a single port connected to VLC/FLC 120, three clockcycles are required to write components S3i", S2i", and S1i".Accordingly, VLC/FLC decoder 120 can use three clock cycles for twodivides which degroup a code Ci, and not cause a pipeline delay inwriting components S3i", S2i", and S1i".

FIG. 2 shows decoding circuit 200 which performs two divides fordegrouping a code Ci in three clock cycles. The first divide is anextended divide that takes two clock cycles. The second divide takes oneclock cycle. Using two clock cycles for the first divide permits use ofa smaller divider and reduces the cost of VLC/FLC decoder 120. In theembodiment of FIG. 2, a divider 210 receives dividend values frommultiplexers 220 and 221 and divides the dividend values by a divisor xequal to 3, 5, or 9 to produce a quotient Q and a remainder Rout. Sideinformation gives the bit allocation for each subband and determines thevalue of divisor x for each subband which requires degrouping.

Code Ci is partitioned into three parts CiH, CiM, and CiL for the firstdivide of degrouping. CiL contains the 2, 3, or 4 least significant bitsof code Ci for divisor x equal to 3, 5, or 9 respectively. CiM containsthe next 2, 3, or 4 more significant bits of code Ci, and CiH containsthe most significant 1, 1, or 2 bits of Ci for divisor x equal to 3, 5,or 9 respectively. CiH is padded on the left with zeros to 2, 3, or 4bits;

Degrouping proceeds as follows. During a first clock cycle, multiplexers220 and 221 assert signals CiH and CiM to divider 210, and divider 210produces a quotient Q1H and a remainder R1' which are written toregisters 231 and 230 at the end of the first clock cycle. Registers 230and 231 in the embodiment of FIG. 2 are edge triggered devices, but inalternative embodiments, registers 230 and 231 may be latches, memorylocations, or any devices capable of holding and asserting digital datasignals. During a second clock cycle, multiplexers 220 and 221 assertrespectively remainder R1' from register 230 and signal CiL to divider210, and divider 210 produces a quotient Q1L and remainder R1. At theend of the second clock cycle, quotient Q1L and remainder R1 are writtento registers 231 and 230 respectively, and quotient Q1H is written fromregister 231 to a register 232. Quotients Q1H and Q1L are respectivelythe most significant and least significant bits of the quotient Q1 givenin eq. 4. Remainder R1 is value S1i" as in eq. 1, 2, or 3.

During a third clock cycle, multiplexers 220 and 221 assert respectivelysignals Q1H and Q1L from registers 230 and 231 to divider 210, divider210 produces quotient Q2 and remainder R2 that are given in eq. 5, and amultiplexer 240 selects value R1 from register 230 for writing to amemory such as ZMEM 134 of FIG. 1. At the end of the third clock cycle,quotient Q2 remainder and R2 are written to registers 231 and 230, andthe quotient Q1L is written from register 231 to register 232.

During a fourth clock cycle, remainder R2 which equals S2i" passesthrough multiplexer 240 and is written to the memory. Quotient Q2 iswritten to register 232 at the end of the fourth clock cycle. QuotientQ2 which equals S3i" is written to memory during the fifth clock cycle.A first divide for a second code Ci' can be performed during the fourthand fifth clock cycles and can proceed as disclosed above. Accordingly,if a series of codes C are degrouped, degrouping proceeds with apipeline delay only for the first code in the series.

Any known or yet to be developed digital divider circuit may be employedfor divider 210 providing the divider circuit handles the correct sizedividend, quotient, and remainder. FIG. 3A shows a block diagram of adivide-by-three circuit 300 which uses the limits on the values of codesC to reduce the number of gates and transistors required.Divide-by-three circuit 300 contains two identical circuit blocks 310and 320. Each block 310 and 320 has input terminals for a 1-bit dividendsignal C and a 2-bit remainder signal Rin and output terminals for a1-bit quotient signal Q and a 2-bit remainder signal Rout. Outputremainder signal Rout from block 310 is asserted as input remaindersignal Rin of block 320. When used in divider 210 of FIG. 2,divide-by-three circuit 300 has a remainder bus 312 connected tomultiplexer 220 (FIG. 2), dividend buses 311 and 321 connected tomultiplexer 221, remainder output bus 324 connected to register 230, andquotient output busses connected to register 231. Multiplexers (notshown) may provide the connections which select divide-by-three circuit300 in response to the corresponding bit allocation of a subband.

FIG. 3B shows a logic table relating the input signals Rin and C tooutput signals Rout and Q for each of circuit blocks 310 and 320. Duringthe first clock cycle, the maximum input signal Rin applied to bus 312equals the maximum signal CiH which is 01 because code Ci Contains onlyfive bits. The maximum remainder for any divide-by-three is 10 binary,and the maximum quotient Q1 of eq. 4 is 0100 binary (26 divided by 3 is8 with remainder 2). Accordingly, input signal Rin which equals CiH, themost significant bits of Q1, or a remainder should never be 11 binary.

The logic table in FIG. 3B reflects the reduced possibilities byindicating output signals Q and Rout as x (don't care) when signal Rinrepresents 11. The remaining entries are generated by dividing 3-bitvalues by three. FIG. 3C shows a gate level diagram which implements thelogic of FIG. 3B. Counting inverters which invert input signals A, B,and C, the implementation of FIG. 3C requires 30 transistors per block310 or 320. Many other circuits can implement the logic table of FIG.3B.

FIG. 4A shows a block diagram of a divide-by-five circuit 400 which usesthe limits on the values of codes C to reduce the number of gates andtransistors required to divide by five. Divide-by-five circuit 400contains three identical blocks 410, 420, and 430 each of which haveinput terminals for a 3-bit remainder signal Rin and a 1-bit dividendsignal Din and output terminals for a 3-bit output remainder signal Routand a 1-bit quotient signal Q. The output remainder signal Rout of block410 is asserted as the input remainder signal Rin of block 420, and theoutput remainder signal Rout of block 420 is asserted as the inputremainder signal Rin of block 430.

When used in divider 210 of FIG. 2, divide-by-five circuit 400 has aremainder bus 412 connected to multiplexer 220 (FIG. 2), dividend buses411, 421, and 431 connected to multiplexer 221, remainder output bus 434connected to register 230, and quotient output busses 413, 423, and 433connected to register 231. Multiplexers may provide the connectionswhich select divide-by-five circuit 400 in response to the bitallocation of five values per subband component.

FIG. 4B shows a logic table relating the possible input signals Rin andD for each block 410, 420, and 430 to the desired output signals Q andRout. FIG. 4C shows a gate level diagram of a circuit which implementsof the logic table of FIG. 4B. The implementation shown requires 48transistors for each of blocks 410, 420, and 430. Other implementationsof the logic table of FIG. 4B are possible in accordance with thisinvention.

FIG. 5A shows a decoding circuit 500 which uses a ROM 550 and an addressgenerator 560 to divide a dividend by nine, five, or three. Two controlsignals Div3 and Div5 are active high to indicate a divide-by-three anda divide-by-five respectively. When both signals Div3 and Div5 are low,an 8-bit dividend indicated by signals R[3:0] and D[3:0] is divided bynine. For a divide-by-nine, signals R[3:0] and D[3:0] pass throughaddress generator 560 unaltered, and provide an address signal A[7:0] toROM 550. ROM 550 holds 8-bit values where the four most significant bitsand the four least significant bits equal the remainder and quotientrespectively that results from dividing an 8-bit dividend R[3:0]:D[3:0]by nine. ROM 550 holds 145 8-bit values at addresses 00000000 to10001111 for dividends between 0 and 10001111 binary. This rangeexhausts the possible dividend to be dividends by nine because thelargest remainder R[3:0] is 1000 (eight).

When Div5 is high, divider 210 divides a 6-bit quotient by five. Inputbits R3 and D3 in signals R[3:0] and D[3:0] are always zero, and inputbits R0, R1, R2, D0, D1, and D2 provide the 6-bit quotient. As shown inFIG. 5B, address generator 560 contains logic which sets address bits A7to A0 of address signals A[7:0] to 1, R2, R1, R2, R0, D2, D1, D0respectively, where R2 is the complement of R2. This provides addressesfor all 6-bit dividends given by signals R[2:0] and D[2:0]. Theaddresses for divide-by-five are greater than 10001111 binary andtherefore do not overlap the addresses for divide-by-nine.

When Div3 is high, divider 210 divides a 4-bit quotient by three. Inputbits R3, R2, D3, and D2 are zero, and input bits R0, R1, D0, and D1provide the 4-bit quotient. As shown in FIG. 5B, address generator 560contains logic which sets bits A7 to A0 of address signals A[7:0] to 1,0, 1, 0, R0, R1, D1, D0 respectively when signal Div3 is high. Thisprovides addresses for all 4-bit quotients. The addresses fordivide-by-three are greater than 10001111 binary and have address bitsA6 and A4 equal to zero. Accordingly, addresses for divide-by-three donot overlap the addresses for divide-by-nine which are less than 1000111or the addresses for divide-by-five which have address bit A6complementary to address bit A4.

ROM 550 contains 199 8-bit output values. The highest required addressis 11000111 binary which contains a remainder and a quotient for 100111divided by five. The largest possible remainder signal R[2:0] is 100binary (four) for a divide-by-five and limits the largest quotient.

VLC/FLC decoder 120 of FIG. 1 identifies and degroups subband codes Ciin a data stream from decoder FIFO buffer 125 and writes quantized andscaled values Si" into ZMEM 134. ZMEM 134 has 192 16-bit words ofstorage, enough to hold components of six sample vectors S". 192 wordsof storage is required because in some cases, a subband code Ci providesvalues S1i", S2i", and S3i" for three vectors Si", S2", and S3" andsubband codes for two channels are interleaved in the data stream underthe MPEG standard. Accordingly, in the worst case, components from sixdifferent vectors (three in each channel) must be decoded before onecomplete vector S" is known.

In the embodiment of FIG. 1, after SPU 140 instructs VLC/FLC decoder 120to get subband data, VLC/FLC decoder 120 reads the bit allocation persubband from QMEM 135, reads subband codes C from decoder FIFO buffer125, degroups subband codes C (if necessary), and writes the scaled andquantized components Si" for six vectors to ZMEM 134, all withoutintervention from SPU 140. This frees SPU 140 for other operations. Inalternative embodiments, SPU 140 can take greater control of reading anddegrouping of subband codes. For example, SPU 140 can read the bitallocation for each subband, and VLC/FLC decoder 120 can degroup eachsubband in response to separate commands from SPU 140. VLC/FLC decoder120 can also be eliminated if SPU 140 performs degrouping of values fromdecoder FIFO buffer 125. SPU 140 is inactive when VLC/FLC 120 isperforming the "get subbands" command because ZMEM 134 does not havespace for more than six vectors. However, VLC/FLC decoder 120 asdescribed above may perform faster degrouping than using SPU 140 andtherefore increases throughput of decoder 100.

Scaled and quantized components Si" correspond to components Si asindicated in eqs. 6 and 7,

    Si'=K1·(Si"+K2)                                   (eq. 6)

    Si=F·Si'                                          (eq. 7)

where constants K1 and K2 depend on the number of bits used to representvalues Si", and the side information of the audio data frame provides anindex which indicates scalefactor F. Applying eq. 6 to a value Si" issometimes referred to herein as dequantizing. Applying eq. 7 to a valueSi' is sometimes referred to herein as descaling. Combinations ofdequantized and descaled vector components Si of a vector S are combinedas described below and stored TMEM 136. TMEM 136 contains sixtyfour22-bit storage locations, 32 storage locations for a vector S, and 32locations for accumulating a set of 32 output sound amplitudes Ai asdescribed below.

Determining output sound amplitudes Ai from sample vector S in TMEMproceeds in steps referred to herein as matrixing and windowing.Matrixing produces a vector V by performing the equivalent of matrixmultiplication of frequency-domain sample vector S by a transformationmatrix N given by the MPEG standard. The components Nji of matrix N are

    Nji= cos [(16+j)(2i+1)π/64]                             (eq. 8)

where 0≦j≦63 and 0≦i≦31. Matrix N is a 32-by-64 matrix which containsonly 31 different positive values A to Z and AA to AE as shown inAppendix A. The remaining components of matrix N are either 0, -1, orare the negative of one of the values A to Z or AA to AE. Eq. 8indicates the values A to Z and AA to AE. Vector V has 64 components Vjgiven by eq. 9. ##EQU1## 32 components Vj of vector V are linearlyindependent.

Determination of each component Vj of vector V, except V16 and V48,requires 32 multiplications of components Si of vector S by componentsNji of matrix N, according to eq. 9. (V16 is always 0, and V48 is thenegative of the sum of the components Si.) Using a butterfly unit todetermine combinations T0 to T31, sums and differences of components S0to S31, reduces the number of multiplications. An example of a set ofcombinations T0 to T31 which reduces the number of multiplicationsrequired to generate vector V is shown in Appendix B. Appendix C showsthe equations that give the components V0 to V63 of vector V in terms ofthe combinations T0 to T31. Components Si and intermediate values usedto calculate T0 to T31 are temporarily stored in a register file of SPU140.

The equations of Appendix C are equivalent to eq. 9 but require fewermultiplications and therefore are calculated more quickly in a digitalsystem. In vector V, component V16 is always zero. Components with anindex which is a multiple of four, V(4n), each require 4multiplications. Components with an index equal to one or three plus amultiple of four, V(4n+1) or V(4n+3), each require 16 multiplications.Components with an index equal to two plus a multiple of four, V(4n+2),each require 8 multiplications. Components V0 to V15 and V49 to V63 areeither the same or the negative of components V32 to V17 and V47 to V33.In SPU 140, a MAC 750 shown in FIG. 7A, multiplies combinations T0 toT31 by quantities stored in a ROM 732 to determine 32 linearlyindependent components such as components V17 to V48 of vector V.Components V17 to V48 are stored in PMEM 137 and written in the orderV48 to V17 to external DRAM 160. Alternative embodiments may use otherlinearly independent sets of components or other orders. As describedbelow, the order of the components written to DRAM 160 determines howwindowing is performed.

Successive vectors S for a channel are converted to vectors V insequential order from the data stream for one or more audio data frames.A superscript is sometimes used herein to distinguish the sequentialorder of vectors V (or S). The components of a vector V⁰ just determinedfrom a vector S⁰ are written to DRAM 160 over the oldest vectorcomponents for the channel. The components of 15 vectors V⁻¹ to V⁻¹⁵ arein DRAM 160 while vector V⁰ is being determined. Windowing combinescomponents from the just determined vectors V.sup. with the componentsof the 15 preceding vectors V⁻¹ to V⁻¹⁵ to provide output soundamplitude values Ai.

According to the MPEG standard, 32 output sound amplitudes Ai are givenby ##EQU2## where 0≦i≦31, vector U has a first set of components definedby U(64m+i)=V^(-2m) i and a second set of components defined byU(64m+32+i)=V⁻(2m+1) (32+i) for 0≦m≦7, and D(i+32k) is a component of a512 component vector given by the MPEG standard. Eq. 10 requires 64components of sixteen vectors V⁰ to V⁻¹⁵ for windowing even though eachvector has only 32 independent components. Storing only the independentcomponents in DRAM 160 reduces the required size of DRAM 160, the timeto write the components after matrixing, and the time to retrievecomponents for windowing.

As shown in Appendix C, each vector V contains 32 linearly independentcomponents. Components V1 to V15 equal the negative of components V17 toV32 respectively. Component V16 equals 0. Components V33 to V47 equalcomponents V63 to V49 respectively, and V48 is independent. Only alinearly independent set such as components V48 to V17 is required forwindowing if some of the components are multiplied by values D(i+32k) ofeq. 10.

As can be seen from eq. 10, one of the first 32 components V^(-2m) ifrom each vector V^(-2m) and one of the last 32 components V⁻(2m+1)(32+i) from each vector V⁻(2m+1) contribute to an output sound amplitudeAi. The first 32 components of each vector V contains only 16independent values. The last 32 components of each vector V contains 17independent values. Accordingly, a total of 33 values from two vectorsV^(-2m) and V⁻(2m+1) are sufficient to determine the contributions ofvectors V^(-2m) and V⁻(2m+1) to 32 output sound amplitudes Ai duringwindowing. Storing the 33 values at consecutive addresses in DRAM 160increases the speed of reading the values for windowing becauseconsecutive address can be accessed with a minimum number of pagechanges.

FIG. 6 shows three alternate memory maps 610, 620, and 630 for a sectionof DRAM 160 of FIG. 1. In the memory map 610, vectors V⁰, V⁻¹, V⁻², V⁻³,. . . V⁻¹⁵ are stored consecutively with components in order from thelowest to highest index. For windowing according to eq. 10,determination of 32 output amplitudes Ai requires the first 32components of each of vectors V⁰, V⁻², . . . V⁻¹⁴ and the last 32components of each of vectors V⁻¹, V⁻³, . . . V⁻¹⁵. Reading componentsfor windowing requires transfers from seven blocks 612, 613, . . . of 64consecutive addresses and two blocks 611 and 619 of 32 consecutiveaddresses. Typically, each of the nine transfers from blocks 611 to 619requires at least one access to a new page. For a typical DRAM,transfers which require changing pages requires extra clock cycles foraddressing and therefore take longer than transfers from a current page.Storing the components of vectors V⁰ to V⁻¹⁵ in order of decreasingindex as shown in memory map 620 reduces the number of transfers toeight blocks 621 to 628 of 64 consecutive addresses.

Memory map 630 stores only 32 linearly independent components Vi forindex i ranging from to 48 to 17 per vector V⁰ to V⁻¹⁵. In alternateembodiments, the set of linearly independent components and the order ofthe components may be changed if suitably matched windowing coefficientsD(i+32k) are employed. For memory map 630, windowing requires transfersfrom eight blocks 631 to 638 of 33 consecutive addresses, and the numberof bytes transferred is cut nearly in half. In practice, at least oneblock of 33 vector components is not at consecutive addresses becausethe current vector V⁰ can be in any of sixteen positions in memory andis not always at the lowest address as shown in memory map 630. In anycase, transfers from memory map 630 are less likely to include a pagebreak than transfers from memory map 620 because block transfers 631 to638 are smaller than block transfers 621 to 628.

Returning to FIG. 1, components of vectors V⁰ to V⁻¹⁵ are transferredfrom memory map 630 (FIG. 6) of DRAM 160 into PMEM 137. The transferredcomponents are multiplied by windowing coefficient D(i+32k) from eq. 10,and the products of the transferred components and windowingcoefficients are accumulated in TMEM 136. Once contributions fromsixteen vectors are accumulated, windowing is complete, and the 32accumulated sound amplitude values Ai in TMEM 136 are written to theaudio output FIFO buffer in DRAM 160.

SPU 140 performs dequantizing, descaling, matrixing, and windowing forall sample vectors S in ZMEM 134, and then more vectors are loaded intoZMEM 134 in response to "get subbands" commands. After reading all ofthe subband information in the audio data frame, SPU 140 may be used fordecoding of MPEG video data frames while a DAC (not shown) reads decodedsound amplitudes from DRAM 160 through audio output FIFO buffer 190.

Circuit blocks 170 to 175 in decoder 100 implement video decoding. Block170 performs half-pixel offsetting and adding of reference blocks toerror terms in accordance with the MPEG standard. Blocks 171 to 175 forma video output unit of audio/video decoder 100. Memory controller 180transfers decoded video data from DRAM 160 to video FIFOs 171.Interpolater 173 expands the decoded video data by two horizontally andby two vertically. Video overlay data such as data representing lyrictext is read from DRAM 160 into overlay FIFO 172, and block 174 blendsthe overlay data with data from interpolater 173 to provide pixelvalues. Converter 175 optionally converts the pixel values from a YCbCrcolor representation to a RGB color representation which is transmittedon video output bus 176.

FIGS. 7A, 7B, and 7C show a block diagram of a signal processing unit140 in accordance with this invention. SPU 140 has an instruction memory(not shown) and a control unit (not shown) which executes a decodingprogram stored in the instruction memory. SPU 140 decodes audio andvideo data frames using information stored in memories 134 to 137. FIG.7A shows portions of SPU 140 for audio decoding. ZMEM 134 is a (3×64)×16bit SRAM and is large enough to store six vectors S" each containingthirty two 16-bit components Si" during audio decoding. During videodecoding, ZMEM 134 is a "zig-zag" memory which stores two or three setsof 64 9-bit video coefficients. QMEM 135 is a 64×(2×8) memory. Duringaudio decoding, QMEM 135 holds 32 subband bit allocations andscalefactor indices for each of two sound channels. During videodecoding, QMEM 135 holds two sets of 64 8-bit components of videoquantizer matrices according to the MPEG standard. Quantizer matricesare swapped between QMEM 135 and DRAM 160 as required when switchingbetween video and audio decoding.

For audio decoding, a VLC/FLC decoder 120 writes six quantized andscaled vectors S" to ZMEM 134 as described above. SPU 140 performs a"dequant/descale" instruction and "window/matrix" instructions on eachvector S" in ZMEM 134. The dequant/descale instruction determinescombinations T0 to T31 from a vector S" by dequantizing, descaling, andbutterfly operations. For descaling, a 16-bit component Si" from ZMEM134 is fed through a multiplexer 716 as an input value Z of MAC 750. Amultiplexer 706 asserts a value X equal to -1 to a register 707 coupledto MAC 750, and multiplexer 712 asserts a value Y which equals K2 asgiven in eq. 6, from ROM 732 to a register 713 coupled to MAC 750. MAC750 determines the product of value X and value Y and then subtractsvalue Z. A register 717 captures the output value from MAC 750 which canbe written to a multiported register file 733 which has three read portsand three write ports. The value Si"+K2 is stored to register file 733.In a second pass through MAC 750, multiplexer 706 asserts signal X equalto Si"+K2 from register file 733, through register 707, to MAC 750.Multiplexer 712 asserts a signal Y equal to K1 (eq. 6) from ROM 732,through register 713, to MAC 750. Multiplexer 716 asserts a value Zequal to zero. The output signal of MAC 750 is a dequantized value Si'which is again written to register file 733.

ROM 732 contains two ROMs 732A and 732B which are alternately accessedto provide ROM 732 with twice the read speed of ROMs 732A and 732B. ROM732 contains constants for dequantizing, descaling, matrixing,windowing, and video decoding. The control unit of SPU 140 determinesthe correct address in ROM 732 from the side information in QMEM 135.

Dequantized value Si' is asserted through multiplexer 706 as a value Xfor descaling. Descaling is performed in two multiplications. For thefirst multiplication, multiplexer 712 and register 713 provide a firstscalefactor F1 which is one of 1, 2^(-1/3), and 2^(-2/3) from ROM 732according to an index from the side information in QMEM 135. Value Zfrom multiplexer 716 is zero. The resulting partly descaled value isheld by register 717, stored to register file 733, and asserted throughmultiplexer 706 and register 707 as value X for the second multiply.Multiplexer 712 and register 713 provide a second scalefactor F2 whichis one of 2⁻¹ to 2⁻²⁰ from ROM 732 according to the index from the sideinformation in QMEM 135, and again value Z is zero. The product of F1and F2 equals scalefactor F of eq. 8. Descaling with two multiplicationsreduces round-off error which might result from a single multiplicationby scalefactor F which is small.

The dequantized and descaled value Si is written to register file 733,and SPU 140 dequantizes and descales a second component Sk" from ZMEM134 in the same manner as described above. When component Sk" isdequantized and descaled to provide component Sk, butterfly unit 760calculates the sum and the difference of Si and Sk. Calculation of sumsand differences is conducted in parallel with dequantizing and descalingother components. Components Si" are descaled and dequantized in 97order that facilitates calculation of sums and differences T0 to T31shown in Appendix B.

One example dequantizes and descales components S0, S31, S15, S16, S7,S24, S8, and S23 in that order for a determination of sum T28. Butterflyunit 760 determines the sum and difference of S0 and S31 while MAC 750determines components S15 and S16. A register 725 holds the sum S0+S31for writing into register file 733. A register 726 holds difference(S0-S31)=T0, which passes through a register 727, a multiplexer 728, anaudio clamp 724, and a multiplexer 723 to be written in TMEM 136.Subsequently, butterfly unit 760 determines the difference (S15-S16)=T15which is similarly stored in TMEM 136 and the sum (S15+S16) which istemporarily stored in register file 733. Next, butterfly unit 760determines the sum and difference of the sums (S0+S31) and (S15+S16).The difference (S0+S31)-(S15+S16)=T15 is saved to TMEM 136. The sum(S0+S31)+(S15+S16) is temporarily stored in register file 733. The samecalculations as performed on S1, S31, S15, and S16 are performed on S7,S24, S8, and S23 to determine (S7-S24)=T7, (S8-S23)=T8,(S7+S24)-(S8+S23)=T23, and (S7+S24)+(S8+S23). Butterfly unit 760 thencombines values (S0+S31)+(S15+S16) and (S7+S24)+(S8+S23) from registerfile 733 to determine difference T24[(S0+S31)+(S15+S16)]-[(S7+S24)+(S8+S23)] and sum T28[(S0+S31)+(S15+S16)]-[(S7+S24)+(S8+S23)], both of which are stored inTMEM 136. The remaining components of vector S are dequantized inparallel with operation of butterfly unit 760 in the order as requiredto determine sums T29 to T31 of Appendix B.

After all combinations T0 to T31 are determined and stored in TMEM 136,SPU executes a window/matrix instruction. Combinations T0 to T31 areasserted to MAC 750 through multiplexer 706 and register 707. MAC 750multiplies combinations T0 to T31 by matrixing coefficients from ROM 732as given in Appendix C to determine components V17 to V48. Butterflyunit 760 performs additions or subtractions needed to accumulatecomponents V17 to V48 which are passed through registers 726 and 727,multiplexer 728, and clamp 729 to be saved in PMEM 137. The number ofmultiplications required is 4, 8, or 16 per component Vi depending onthe index.

Windowing filters vector components Vi which result from matrixing. Foreach window/matrix instruction, memory controller 180 reads sets of 33previous vector components as in memory map 630 of DRAM 160, into PMEM137 with the 33 previous vector components from oldest vectors (fromvectors V⁻¹⁵ and V⁻¹⁴) being read from DRAM 160 first. The previousvector components in PMEM 137 are fed through multiplexer 706 andregister 707 to MAC 750. MAC 750 multiplies the previous vectorcomponents by windowing coefficients D(i+32k) and accumulates theproduct into 32 sound amplitude values being accumulated in TMEM 136.For each set of 33 vector components, 64 multiplies are performed, andtwo values are accumulated for each sound amplitude value.

Matrixing and windowing of a vector requires eight window/matrixinstructions. Each window/matrix instruction determines and stores intoDRAM 160 four components of a vector V⁰, and accumulates two windowingcontributions for each of 32 sound amplitude values Ai. Before the firstwindow/matrix instruction, old sound amplitude values Ai must be savedfrom TMEM 136 to DRAM 160. Saving old sound amplitude values can beperformed simultaneously with dequantizing and descaling of a new vectorif TMEM 136 is dual ported or if writes to TMEM 136 during thedequantizing and descaling process can be stalled. Otherwisewindow/matrix instruction must wait until old sound amplitude values aresaved to DRAM 160. Window/matrix instruction also must wait untildequantizing and descaling of the current vector is complete.

Initially, memory controller 180 transfers 33 vector components fromDRAM 160 to a first portion of PMEM 137. For the MPEG standard, vectorcomponents are kept to 20 bits of accuracy, but standard DRAM have16-bit storage locations. Accordingly, 33 vector components are storedat 42 addresses in DRAM 160. PMEM 137 is 18 bits wide for holding two9-bit video error terms. Vector components are stored in PMEM 137 in 42addresses as received from DRAM 160. Once the 33 vector components arein PMEM 137, SPU 140 begins executing a window/matrix instruction on thefirst portion of PMEM 137 and retrieves 20-bit components as required.The window/matrix instruction accumulates the windowing contributions ofthe 33 components in PMEM 137 to the sound amplitude values Ai in TMEM136 and determines a set of four vector components of the current vectorV⁰. It should be noted that each set of four vector components V17 toV20, V21 to V24, V25 to V28, V29 to V32, V33 to V36, V37 to V40, V41 toV44, and V45 to V48 if determined by the equations in Appendix Crequires 44 multiplications. The set of four vector componentsdetermined by matrixing are stored in PMEM 137.

Simultaneously with execution of the window/matrix instruction, memorycontroller 180 transfers 33 more vector components from DRAM 160 to asecond portion of PMEM 137. When a window/matrix instruction iscomplete, four Vector components are written from PMEM 137 to DRAM 160,and then another window/matrixing instruction begins using the secondportion of PMEM 137. The eighth and final window/matrix instruction fora vector V⁰ uses components of vector V⁰. Since windowing only requirescomponents V⁰ 17 to V⁰ 33 for windowing, the necessary components forwindowing are calculated and stored in DRAM 160 in previouswindow/matrix instructions before being retrieved for windowing. Afterthe eighth window/matrix instruction, the 32 sound amplitude values Aiare ready for transfer from TMEM 136 to DRAM 160. Audio clamp 724 clampsthe accumulated sound amplitude values Ai to 16 bits for writing to DRAM160. If dequantizing and descaling is not stallable, SPU 140 waits whilememory controller 180 transfers sound amplitude values Ai to DRAM 160.

An advantage of the combined window/matrix step arises because multiplytime limits matrixing, and windowing is slightly limited by memoryaccess to DRAM 160. Combining windowing and matrixing provides aninstruction that more evenly utilizes the resources of SPU 140 anddecoder 100. Additionally, if the windowing and matrixing were notcombined transfers from DRAM 160 to video FIFOs 171 and 172 (and FIFOs125, 115, and 190) would delay windowing. By combining windowing andmatrixing, transfers from DRAM 160 to video FIFOs 171 and 172 canoverlap the window/matrix computations because matrixing does not usemuch DRAM bandwidth. Matrixing only needs to write four 20-bit values toDRAM 160.

FIG. 8A illustrates a process loop executed by CPU 150 for audio dataframe decoding, and FIG. 8B shows the timing of the process loop.Initially, in step 805, CPU 150 loads QMEM 135 with scalefactor indicesand bit allocations for a layer 1 audio data frame or for part of alayer 2 audio data frame and then in step 810, requests that memorycontroller 180 transfer 33 vector components from DRAM 160 to PMEM 137.The 33 vector components are transferred to a first half of PMEM 137during time T1 (FIG. 8B). Meanwhile, CPU 150 issues a get subbandscommand in step 820 that VLC/FLC decoder 120 executes in parallel withthe transfer during time T1. The get subbands command as disclosed abovemoves components for six vectors into ZMEM 134. CPU 150 waits in step825 until VLC/FLC decoder 120 is idle before issuing a dequant/descalecommand in step 835. SPU 140 performs the dequant/descale command inparallel with the transfer during time T1.

SPU 140 can not proceed from the dequant/descale command to awindow/matrix command until transfer of 33 vector components requestedin step 810 is complete because the 33 vector components are requiredfor windowing. SPU requires the results of the dequant/descale command(step 835) for matrixing. Additionally, window/matrix commands can notbegin until previously determined sound amplitude values are saved fromTMEM 136 to DRAM 160. Accordingly, CPU 150 waits in steps 840, 845, and855 before directing SPU 140 to execute a window/matrix command in step860. During a time T2, the window/matrix command is performed asdisclosed above. In step 865, CPU 150 requests that memory controller180 transfer 33 more vector components from DRAM 160 to a second half ofPMEM 137. The transfer of 33 more components occurs during time T3 inparallel with the window/matrix command of step 860. Memory controller180 does not interfere with data being used by SPU 140 because memorycontroller 180 and SPU 140 access different halves of PMEM 137.

CPU 150 waits in step 870 until SPU 140 completes the window/matrixcommand, before requesting in step 875 that memory controller 180transfer to DRAM 160 four vector components just determined by thewindow/matrix command. The transfer to DRAM 160 occurs during a time T4.CPU 150 transitions through step 880 back to step 855 and waits untilthe 33 components requested in step 865 are transferred to the secondhalf of PMEM 137. Decoding proceeds as disclosed above except that asecond window/matrix command of step 860 operates on the second half ofPMEM 137, and a second execution of step 865 request a transfer of 33vector components to the first half of PMEM 137. SPU 140 executes thesecond window/matrix command during a time T5 and in parallel withtransfer of the previously four vector components to DRAM 160 duringtime T4 and then in parallel with transfer of the next set of 33 vectorcomponents from DRAM 160 during time T6 as shown in FIG. 8B.

Steps 855 to 880 are repeated eight times. In each iteration, steps 860and 865 alternate operating on the first and second halves of PMEM 137.During an eighth iteration of steps 855 to 880, vector components forwindowing the next vector are requested in step 865 unless the vector isthe last vector of the last set of vectors. After the eight iterationsof the window/matrix command, CPU 150 transitions to step 885 andrequests transfer of the 32 just determined sound amplitude values Aifrom TMEM 136 to DRAM 160. CPU 150 transitions to step 890 and then step835 and begins a dequant/descale command for the next vector in ZMEM134. A loop from step 835 to step 890 is executed six times to decodethree vectors in each of two channels. After the six vectors aredecoded, CPU 150 jumps from step 895 to step 820 to get subband data fora next set of six vectors. A loop from step 820 to step 895 is executedfor four sets of vectors. After four sets of six vectors, new bitallocations and scalefactor indices are needed.

Appendix D contains a C code listing of a program which executes thesteps of dequantizing, descaling, matrixing, and windowing as describedabove.

Audio/video decoder 100 (FIG. 1) of this invention also performs videodecoding according to the MPEG standard. Video decoding under the MPEGstandard is described in U.S. patent applications Ser. Nos. 07/890,732and 07/669,818 which were incorporated by reference above. VLC/FLCdecoder 120 converts codes in a video data stream from decoder FIFO 125into quantized discrete cosine transformation (DCT) coefficients whichare stored in ZMEM 134. For video decoding, ZMEM 134 is sometimesreferred to as a zig-zag memory because of the order in whichcoefficients are stored. QMEM 135 holds dequantization constants whichare swapped into QMEM 135 from DRAM 160 after audio decoding or arechanged according to the video data stream. SPU 140 uses thedequantization constants for dequantizing the DCT coefficients.

SPU 140 multiplies the dequantized DCT coefficients by a cosine factorand then converts the DCT coefficients to pixel values by atwo-dimensional inverse discrete cosine transformation (IDCT). Thetwo-dimensional IDCT may be performed as two one-dimensional IDCTs, andTMEM 136 is used to hold intermediate values during the IDCT. After theIDCT, the resulting error terms are stored into PMEM 137 and thenwritten to DRAM 160. Decoded video is read from DRAM 160 through blocks171 to 175 for output on video bus 176.

SPU 140 executes operations including the dequantization, the cosinemultiply, and the IDCT described above and in U.S. patent applicationSer. No. 07/890,732. In addition to the blocks shown in FIG. 7A, SPU 140uses the circuit blocks shown in FIGS. 7B and 7C during a videodecoding. During a cosine multiply operation, a multiplexer 712 is setto select a cosine factor from ROM 732 which MAC 750 multiplies by a DCTcoefficient. For a dequantization instruction, a dequantization constantis retrieved from QMEM 135 via a multiplexer 714 and a register 715.Multiplexer selects either the most or least significant eight bits ofan a 16-bit signal from QMEM 135. A multiplier 711 scales thedequantization constant by a value provided by a multiplexer 710.Multiplexer 710 selects either a fixed constant for the DC term of intramacroblocks or a 5-bit scaling factor from registers 708 and 709.Multiplier 711 provides the scaled dequantization constant viamultiplexer 712 and a register 713 to MAC 750 for multiplication by aDCT coefficient retrieved from ZMEM 134.

Prior to being asserted to MAC 750, each 9-bit DCT coefficient from ZMEM134 may be padded, decremented by decrementer 704, made odd or roundedtowards zero by rounder 733, or clipped to a predetermined range byclamp 705, according to the requirements of the MPEG standard. AND gate702 sets a 9-bit DCT coefficient from ZMEM 134 to zero in response to acontrol signal "coded". During a video dequantization instruction,multiplexer 703 selects output signal decrin[10:0] equal to an 11-bitsignal formed by padding the 9-bit zQCode[8:0] from gate 702, on theright. Alternatively, when executing an instruction other than adequantization instruction, multiplexer 703 selects signal decrin[10:0]equal to an 11-bit signal SRC3[13:3] from register file 733. Decrementer704 decrements signal decrin[10:0] when required by the MPEG standard toprovide an output signal decrout[10:0]. If a decrement operation is notrequired, signal decrout[10:0] equals signal decrin[10:0].

Rounder 733 replaces bits 0 (the LSB) and 4 of the output datum ofsignal decrout[10:0] if required under the MPEG standard. Rounder 733zeros signal decrout[10:0] if the DCT coefficient from ZMEM 134 is zero,during execution of a dequantization instruction, or signal SRC3[13:3]is zero, during execution of a non-dequantization instruction (e.g. acosine multiply instruction). Bits [21:14] of signal SRC3 from theregister file 733 prefixes to signal decrout[10:0] resulting in a 19-bitsignal CLAMPIN[18:0] which is passed into clamp 705. Clamp 705 clampssignal CLAMPIN[18:0] to a 14-bit signal CLAMPOUT[13:0] having valuesbetween -2047 and 2047 during execution of a non-dequantizationinstruction. Alternatively, during a dequantization instruction, clamp705 passes the input signal unchanged. Signal CLAMPOUT[13:0] is thenzero-padded on the right to form a 22-bit signal passed throughmultiplexer 706 and register 707 as the signal X to MAC 750.

MAC 750 can, depending on the instruction executed, multiply two numbersX and Y (e.g. in a dequantization or cosine multiply instruction), orcompute the value of the expression X*Y-Z (e.g. in an IDCTmultiply-subtract instruction). The DCT coefficients are fetched fromeither ZMEM 134 or TMEM 136 to register file 733. In addition, theresulting value from MAC 750 can be routed as an operand to butterflyunit 760 bypassing register file 733.

Butterfly unit 760 computes simultaneously the sum and the difference oftwo input operands X and Y. Since MAC 750 and butterfly unit 760 caneach operate on their respective operands in parallel during theexecution of a multiply instruction, a multiply instruction can resultin both a multiplication result and a butterfly result. Additionally, apipeline is achieved by using the output value (an "intermediate"result) of MAC 750 directly through multiplexer 718 to butterfly unit760. This arrangement increases throughput because the delay caused byloading then reading an intermediate result in register file 733 iseliminated.

The results from a butterfly operation of a first pass IDCT are routedinto TMEM 136, whereas the results from a butterfly operation of asecond pass IDCT operation are "clipped" by clamp 729 and routed to PMEM137. A program executable by SPU 140 for video decoding is described inU.S. patent application Ser. No. 07/890,732.

The MPEG Standard does not define an error code that is injected intothe audio bit stream because any possible bit combination can validlyappear in the bit stream of a layer 1 or layer 2 audio data frame.Instead a CD-DSP may generate a separate error signal for any audio databyte which includes a detected error. The audio/video decoder 100 ofFIG. 1 includes an audio error code injector 118 which when an errorsignal is received from a CD-DSP, changes a section of audio datareceived on serial bus 104 to a bit combination that is rare in audiodata frames. Code FIFO 115 is 18 bits wide to store two bytes of codeddata each with a ninth bit for the error signal. Audio error codeinjector 118 checks the error bit of the coded data, and if the errorbit is set, overwrites the byte with an error code. For example, ifdecoder 100 receives an error signal while receiving an audio datastream, audio error code injector 118 inserts a 32-bit word alignedvalue 7FFD7FFD hexadecimal into an audio data frame. In this case, theerror coded replaces the byte with the error and three other bytes. In astatistical study of MPEG data frames for actual sounds, the 32-bitvalue $7FFD7FFD was estimated to occur less than once every 100 hours ofaudio data.

Bytes with errors can not be overwritten with an error code when writteninto code FIFO 115 because different types of data streams typically usedifferent error codes, and decoder 100 does not identify the type ofdata stream containing the error until the data is removed from codeFIFO 115. For example, audio/video decoder 100 may-receive an audio datastream, a video data stream, and a lyric data stream. Errors in thevideo data stream are overwritten with $000001B4. Errors in the lyricdata stream are overwritten with 32 bits of zero.

When an error signal for an audio data frame is received, host interface110 inserts a 1 into an 8-bit shift register that is shifted once forevery audio data packet. Accordingly, the value in the shift register isnot zero for a number of audio data frames greater than or equal to thenumber of shifts required to move the 1 out of the shift register. Thevalue in the shift register is non-zero for the time that an input audiodata buffer in DRAM 160 could contain an error code. VLC/FLC decoder 120checks for bit combinations equal to the error code in all audio framesthat are decoded while the Value in the shift register is not zero. Ifthe bit combination is detected, the VLC/FLC decoder 120 initiates anerror concealment procedure. Bit combinations which are not actualinjected error codes are rarely detected because the chances of the bitcombination occurring within a short time interval of an audio framecontaining an error are small.

The error concealment procedure tries to minimize the effect that theerror in the data stream has on sound quality. For example, if the errorcode occurs in subband data, VLC/FLC decoder 120 replaces the componentscorrupted by the error code with zeros, so that the generated sound isonly missing some frequency components. If the error code corrupts theheader or side information of an audio data frame so that the audio dataframe can not be decoded, VLC/FLC decoder 120 generates an interrupt toCPU 150. CPU 150 can try to reconstruct the missing data using previousaudio data frames or cause SPU 140 to decode again the previous audiodata frame for the channel.

Although the present invention has been described with reference toparticular embodiments, the description is only an example of theinvention's application and should not be taken as a limitation. Variousadaptations and combinations of features of the embodiments disclosedwill be apparent to those skilled in the art and are within the scope ofthe present invention as defined by the following claims.

    __________________________________________________________________________    Appendix A                                                                    Matrix Coefficients (Nji)                                                     __________________________________________________________________________    0    1  2  3  4  5  6  7  8  9  10 11 12 13 14 15                             __________________________________________________________________________      P  -P -P P  P  -P -P P  P  -P -P P  P  -P -P P                               1                                                                              O  -S -K W  G  -AA                                                                              -C AE -A -AC                                                                              E  Y  -I -U M  Q                               2                                                                              N  -V -F AD -B -Z J  R  -R -J Z  B  -AD                                                                              F  V  -N                              3                                                                              M  -Y -A AA -K -O W  C  -AC                                                                              I  Q  -U -E AE -G -S                              4                                                                              L  -AB                                                                              D  T  -T -D AB -L -L AB -D -T T  D  -AB                                                                              L                               5                                                                              K  -AE                                                                              I  M  -AC                                                                              G  O  -AA                                                                              E  Q  -Y C  S  -W A  U                               6                                                                              J  -AD                                                                              N  F  -Z R  B  -V V  -B -R Z  -F -N AD -J                              7                                                                              I  -AA                                                                              S  -A -Q AC -K -G Y  -U C  O  -AE                                                                              M  E  -W                              8                                                                              H  -X X  -H -H X  -X H  H  -X X  -H -H X  -X H                               9                                                                              G  -U AC -O A  M  -AA                                                                              W  -I -E S  -AE                                                                              Q  -C -K Y                              10                                                                              F  -R AD -C J  B  -N Z  -Z N  -B -J V  -AD                                                                              R  -F                             11                                                                              E  -O Y  -AC                                                                              S  -I -A K  -U AE -W M  -C -G Q  -2                             12                                                                              D  -L T  -AB                                                                              AB -T L  -D -D L  -T AB -AB                                                                              T  -L D                              13                                                                              C  -I O  -U AA Y  -AE                                                                              -S M  -G A  E  -K Q  -W 4                              14                                                                              B  -F J  -N R  -V Z  -AD                                                                              AD -Z V  -R N  -J F  -B                             15                                                                              A  -C E  -G I  -K M  -O Q  -S U  -W Y  -AA                                                                              AC -6                             16                                                                              0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0                              17                                                                              A  C  -E G  -I K  -M O  -Q S  -U W  -Y AA -AC                                                                              6                              18                                                                              B  F  -J N  -R V  -Z AD -AD                                                                              Z  -V R  -N J  -F B                              19                                                                              C  I  -O U  -AA                                                                              AE -Y S  -M G  -A -E K  -Q W  -4                             20                                                                              D  O  -Y AC -S I  A  -K U  -AE                                                                              W  -M C  G  -Q 2                              21                                                                              D  O  -Y AC -S I  A  -K U  -AE                                                                              W  -M C  G  -Q 2                              22                                                                              F  R  -AD                                                                              V  -J -B N  -Z Z  -N B  J  -V AD -R F                              23                                                                              G  U  -AC                                                                              O  -A -M AA -W I  E  -A AE -Q C  K  -Y                             24                                                                              H  X  -X H  H  -X X  -H -H X  -X H  H  -X X  -H                             25                                                                              I  AA -S A  Q  -AC                                                                              K  G  -Y U  -C -O AE -M -E W                              26                                                                              J  AD -N -F Z  -R -B V  -V B  R  -Z F  N  -AD                                                                              J                              27                                                                              K  AE -I -M AC -G -O AA -E -Q Y  -C -S W  -A -U                             28                                                                              L  AB -D -T T  D  -AB                                                                              L  L  -AB                                                                              D  T  -T -D AB -L                             29                                                                              M  Y  A  -AA                                                                              K  O  -W -C AC -I -Q U  E  -AE                                                                              G  S                              30                                                                              N  V  F  -AD                                                                              B  Z  -J -R R  J  -Z -B AD -F -V N                              31                                                                              O  S  K  -W -G AA C  -AE                                                                              A  AC -E -Y I  U  -M Q                              32                                                                              P  P  P  -P -P P  P  -P -P P  P  -P -P P  P  -P                             33                                                                              Q  M  U  -I -Y E  AC -A -AE                                                                              -C AA G  -W -K S  O                              34                                                                              R  J  Z  -B -AD                                                                              -F V  N  -N -V F  AD B  -Z -J R                              35                                                                              S  G  AE E  -U -Q I  AC C  -W -O K  AA A  -Y -M                             36                                                                              T  D  AB L  -L -AB                                                                              -D T  T  -D -AB                                                                              -L L  AB D  -T                             37                                                                              U  A  W  S  -C -Y -Q E  AA O  -G -AC                                                                              -M I  AE K                              38                                                                              V  -B R  Z  F  -N -AD                                                                              -J J  AD N  -F -Z -R B  V                              39                                                                              W  -E M  AE O  -C -U -Y -G K  AC Q  -A -S -AA                                                                              -I                             40                                                                              X  -H H  X  X  H  -H -X -X -H H  X  X  H  -H -X                             41                                                                              -Y -K C  Q  AE S  E  -I -W -AA                                                                              -M A  O  AC U  G                              42                                                                              -Z -N -B J  V  AD R  F  -F -R -AD                                                                              -V -J B  N  Z                              43                                                                              -AA                                                                              -Q -G C  M  W  AE U  K  A  -I -S -AC                                                                              -Y -O -E                             44                                                                              -AB                                                                              -T -L -D D  L  T  AB AB T  L  D  -D -L -T -3                             45                                                                              -AC                                                                              -W -Q -K -E A  G  M  S  Y  AE AA U  O  I  C                              46                                                                              -AD                                                                              -Z -V -R -N -J -F -B B  F  J  N  R  V  Z  5                              47                                                                              -AE                                                                              -AC                                                                              -AA                                                                              -Y -W -U -S -Q -O -M -K -I -G -E -C -A                             48                                                                              -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1                             49                                                                              -AE                                                                              -AC                                                                              -AA                                                                              -Y -W -U -S -Q -O -M -K -I -G -E -C -A                             50                                                                              -AD                                                                              -Z -V -R -N -J -F -B B  F  J  N  R  V  Z  5                              51                                                                              -AC                                                                              -W -Q -K -E A  G  M  S  Y  AE AA U  O  I  C                              52                                                                              -AB                                                                              -T -L -D D  L  T  AB AB T  L  D  -D -L -T -3                             53                                                                              -AA                                                                              -Q -G C  M  W  AE U  K  A  -I -S -AC                                                                              -Y -O -E                             54                                                                              -Z -N -B J  V  AD R  F  -F -R -AD                                                                              -V -J B  N  Z                              55                                                                              -Y -K C  Q  AE S  E  -I -W -AA                                                                              -M A  O  AC U  G                              56                                                                              -X -H H  X  X  H  -H -X -X -H H  X  X  H  -H -X                             57                                                                              -W -E M  AE O  -C -U -Y -G K  AC Q  -A -S -AA                                                                              -I                             58                                                                              -V -B R  Z  F  -N -AD                                                                              -J J  AD N  -F -Z -R B  V                              59                                                                              -U A  W  S  -C -Y -Q E  AA O  -G -AC                                                                              -M I  AE K                              60                                                                              -T D  AB L  -L -AB                                                                              -D T  T  -D -AB                                                                              -L L  AB D  -T                             61                                                                              -S G  AE E  -U -Q I  AC C  -W -O K  AA A  -Y -M                             62                                                                              -R J  Z  -B -AD                                                                              -F V  N  -N -V F  AD B  -Z -J R                              63                                                                              -Q M  U  -I -Y E  AC -A -AE                                                                              -C -AA                                                                              G  -W -K S  O                              __________________________________________________________________________    16   17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                             __________________________________________________________________________      P  -P -P P  P  -P -P P  P  -P -P P  P  -P -P P                               1                                                                              -Q -M U  I  -Y -E AC A  -AE                                                                              C  AA -G -W K  S  -O                              2                                                                              -N V  F  -AD                                                                              B  Z  -J -R R  J  -Z -B AD -F -V N                               3                                                                              S  G  -AE                                                                              E  U  -Q -I AC -C -W O  K  -AA                                                                              A  Y  -M                              4                                                                              L  -AB                                                                              D  T  -T -D AB -L -L AB -D -T T  D  -AE                                                                              L                               5                                                                              -U -A W  -S -C Y  -Q -E AA -O -G AC -M -I AE -K                              6                                                                              -J AD -N -F S  -R -B V  -V B  R  -  F  N  -AD                                                                              J                               7                                                                              W  -E -M AE -O -C U  -Y G  K  -AC                                                                              Q  A  -S AA -I                              8                                                                              H  -X X  -H -H X  -X H  H  -X X  -H -H X  -X H                               9                                                                              -Y K  C  -Q AE -S E  I  -W AA -M -A O  -AC                                                                              U  -G                             10                                                                              -F R  -AD                                                                              V  -J -B N  -Z Z  -N B  J  -V AD -R F                              11                                                                              AA -Q G  C  -M W  -AE                                                                              U  -K A  I  -S AC -Y O  -E                             12                                                                              D  -L T  -AB                                                                              AB -T L  -D -D L  -T AB -AB                                                                              T  -L D                              13                                                                              -AC                                                                              W  -Q K  -E -A G  -M S  -Y AE -AA                                                                              U  -O I  -C                             14                                                                              -B F  -J N  -R V  -Z AD -AD                                                                              Z  -V R  -N J  -F B                              15                                                                              AE -AC                                                                              AA -Y W  -U S  -Q O  -M K  -I G  -E C  -A                             16                                                                              0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0                              17                                                                              -AE                                                                              AC -AA                                                                              Y  -W U  -S Q  -O M  -K I  -G E  -C A                              18                                                                              B  -F J  -N R  -V Z  -AD                                                                              AD -Z V  -R N  -J F  -B                             19                                                                              AC -W Q  -K E  A  -G M  -S Y  -AE                                                                              AA -U O  -I C                              20                                                                              -D L  -T AB -AB                                                                              T  -L D  D  -L T  -AB                                                                              AB -T L  -D                             21                                                                              -AA                                                                              Q  -G -C M  -W AE -U K  -A -I S  -AC                                                                              Y  -O E                              22                                                                              F  -R AD -V J  B  -N Z  -Z N  -B -J V  -AD                                                                              R  -F                             23                                                                              Y  -K -C Q  -AE                                                                              S  -E -I W  -AA                                                                              M  A  -O AC -U G                              24                                                                              -H X  -X H  H  -X X  -H -H X  -X H  H  -X X  -H                             25                                                                              -W E  M  -AE                                                                              O  C  -U Y  -G -K AC -Q -A S  -AA                                                                              I                              26                                                                              J  -AD                                                                              N  F  -Z R  B  -V V  -B -R Z  -F -N AD -J                             27                                                                              U  A  -W S  C  -Y Q  E  -AA                                                                              O  G  -AC                                                                              M  I  -AE                                                                              K                              28                                                                              -L AB -D -R T  D  -AB                                                                              L  L  -AB                                                                              D  T  -T -D AB -L                             29                                                                              -S -G AE -E -U Q  I  -AC                                                                              C  W  -O -K AA -A -Y M                              30                                                                              N  -V -F AD -B -Z J  R  -R -J Z  B  -AD                                                                              F  V  -N                             31                                                                              Q  M  -U -I Y  E  -AC                                                                              -A AE -C -AA                                                                              G  W  -K -S O                              32                                                                              -P P  P  -P -P P  P  -P -P P  P  -P -P P  P  -P                             33                                                                              -O -S K  W  -G -AA                                                                              C  AE A  -AC                                                                              -E Y  I  -U -M Q                              34                                                                              R  -J -Z B  AD F  -V -N N  V  -F -AD                                                                              -B Z  J  -R                             35                                                                              M  Y  -A -AA                                                                              -K O  W  -C -AC                                                                              -I Q  U  -E -AE                                                                              -G S                              36                                                                              -T D  AB L  -L -AB                                                                              -D T  T  -D -AB                                                                              -L L  AB D  -T                             37                                                                              -K -AE                                                                              -I M  AC G  -O -AA                                                                              -E Q  Y  C  -S -W -A U                              38                                                                              V  B  -R -Z -F N  AD J  -J -AD                                                                              -N F  Z  R  -B -V                             39                                                                              I  AA S  A  -Q -AC                                                                              -K G  Y  U  C  -O -AE                                                                              -M E  W                              40                                                                              -X -H H  X  X  H  -H -X -X -H H  X  X  H  -H -X                             41                                                                              -G -U -AC                                                                              -O -A M  AA W  I  -E -S -AE                                                                              -Q -C K  Y                              42                                                                              Z  N  B  -J -V -AD                                                                              -R -F F  R  AD V  J  -B -N -Z                             43                                                                              E  O  Y  AC S  U  -A-                                                                              K  U  -AE                                                                              -W -M -C G  Q  2                              44                                                                              -AB                                                                              -T -L -D D  L  T  AB AB T  L  D  -D -L -T -3                             45                                                                              -C -I -O -U -AA                                                                              -AE                                                                              -Y -S -M -G -A E  K  Q  W  4                              46                                                                              AD Z  V  R  N  J  F  B  -B -F -J -N -R -V -Z -5                             47                                                                              A  C  E  G  I  K  M  O  Q  S  U  W  Y  AA AC 6                              48                                                                              -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1                             49                                                                              A  C  E  G  I  K  M  O  Q  S  U  W  Y  AA AC 6                              50                                                                              AD Z  V  R  N  J  F  B  -B -F -J -N -R -V -E -5                             51                                                                              -C -I -O -U -AA                                                                              -AE                                                                              -Y -S -M -G -A E  K  Q  W  4                              52                                                                              -AB                                                                              -T -L -D D  L  T  AB AB T  L  D  -D -L -T -3                             53                                                                              E  O  Y  AC S  I  -A -K -Y -AE                                                                              -W -M -C G  Q  2                              54                                                                              Z  N  B  -J -V -AD                                                                              -R -F F  R  AD V  J  -B -N -Z                             55                                                                              -G -U -AC                                                                              -O -A M  AA W  I  -E -S -AE                                                                              -Q -C K  Y                              56                                                                              -X -H H  X  X  H  -H -X -X -H H  X  X  H  -H -X                             57                                                                              I  AA S  A  -Q -AC                                                                              -K G  Y  U  C  -O -AE                                                                              -M E  W                              58                                                                              V  B  -R -Z -F N  AD J  -J -AD                                                                              -N F  Z  R  -B -V                             59                                                                              -K -AE                                                                              -I M  AC G  -O -AA                                                                              -E Q  Y  C  -S -W -A U                              60                                                                              -T D  AB L  -L -AB                                                                              -D T  T  -D -AB                                                                              -L L  AB D  -T                             61                                                                              M  Y  -A -AA                                                                              -K O  W  -C -AC                                                                              -I Q  U  -E -AE                                                                              -G S                              62                                                                              R  -J -Z B  AD F  -V -N N  V  -F -AD                                                                              -B Z  J  -R                             63                                                                              -O -S K  W  -G -AA                                                                              C  AE A  -AC                                                                              -E Y  I  -U -M Q                              __________________________________________________________________________

    ______________________________________                                        Appendix B                                                                    Results of Dequant/Descale Instruction                                        ______________________________________                                        T0 = (S0 - S31)                                                               T1 = (S1 - S30)                                                               T2 = (S2 - S29)                                                               T3 = (S3 - S28)                                                               T4 = (S4 - S27)                                                               T5 = (S5 - S26)                                                               T6 = (S6 - S25)                                                               T7 = (S7 - S24)                                                               T8 = (S8 - S23)                                                               T9 = (S9 - S22)                                                               T10 = (S10 - S21)                                                             T11 = (S11 - S20)                                                             T12 = (S12 - S19)                                                             T13 = (S13 - S18)                                                             T14 = (S14 - S17)                                                             T15 = (S15 - S16)                                                             T16 = (S0 + S31) - (S15 + S16)                                                T17 = (S1 + S30) - (S14 + S17)                                                T18 = (S2 + S29) - (S13 + S18)                                                T19 = (S3 + S28) - (S12 + S19)                                                T20 = (S4 + S27) - (S11 + S20)                                                T21 = (S5 + S26) - (S10 + S21)                                                T22 = (S6 + S25) - (S9 + S22)                                                 T23 = (S7 + S24) - (S8 + S23)                                                 T24 = [(S0 + S31) + (S15 + S16)]- [(S7 + S24) + (S8 + S23)]                   T25 = [(S1 + S30) + (S14 + S17)]- [(S6 + S25) + (S9 + S22)]                   T26 = [(S2 + S29) + (S13 + S18)]- [(S5 + S26) + (S10 + S21)]                  T27 = [(S3 + S28) + (S12 + S19)]- [(S4 + S27) + (S11 + S20)]                  T28 = [(S0 + S31) + (S15 + S16)]+ [(S7 + S24) + (S8 + S23)]                   T29 = [(S1 + S30) + (S14 + S17)]+ [(S6 + S25) + (S9 + S22)]                   T30 = [(S2 + S29) + (S13 + S18)]+ [(S5 + S26) + (S10 + S21)]                  T31 = [(S3 + S28) + (S12 + S19)]+ [(S4 + S27) + (S11 + S20)]                  ______________________________________                                    

    ______________________________________                                        Appendix C                                                                    Matrix Equations                                                              ______________________________________                                        V0 =  P*28 - P*T29 - P*T30 + P*T31                                            V1 =  O*T0 - S*T1 - K*T2 + W*T3 + G*T4 - AA*T5 - C*T6                               + AE*T7 - A*T8 - AC*T9 + E*T10 + Y*T11 - I*T12                                - U*T13 + M*T14 + Q*T15                                                 V2 =  N*T16 - V*T17 - F*T18 + AD*T19 - B*T20 - Z*T21                                +J*T22 + R*T23                                                          V3 =  M*T0 - Y*T1 - A*T2 + AA*T3 - K*T4 - 0*T5 + W*T6                               + C*T7 - AC*T8 + I*T9 + Q*T10 - U*T11 - E*T12                                 + AE*T13 - G*T14 - S*T15                                                V4 =  L*T24 - AB*T25 + D*T26 + T*T27                                          V5 =  K*T0 - AE*T1 + I*T2 + M*T3 - AC*T4 + G*T5 + O*T6                              - AA*T7 + E*T8 + Q*T9 - Y*T10 + C*T11 + S*T12                                 - AA*T13 + A*T14 + U*T15                                                V6 =  J*T16 - AD*T17 + N*T18 + F*T19 - Z*T20 + R*T21                                + B*T22 - V*T23                                                         V7 =  I*T0 - AA*T1 + S*T2 - A*T3 - Q*T4 + AC*T5 - K*T6                              - G*T7 + U*T8 - U*T9 + C*T10 + O*T11 - AE*T12                                 + M*T13 + E*T14 - W*T15                                                 V8 =  H*T28 - X*T29 + X*T30 - H*T31                                           V9 =  G*T0 - U*T1 + AC*T2 - O*T3 + A*T4 + M*T5 - AA*T6                              + W*T7 - I*T8 + E*T9 + S*T10 - AE*T11 + Q*T12                                 - C*T13 - K*T14 + Y*T15                                                 V10 = F*T16 - R*T17 + AD*T18 - V*T19 + J*T20 + B*T21                                - N*T22 + Z*T23                                                         V11 = E*T0 - O*T1 + Y*T2 - AC*T3 + S*T4 - I*T4 - I*T5 - A*T6                        + K*T7 - U*T8 + AE*T9 - W*T10 + M*T11 - C*T12                                 - G*T13 + Q*T14 - AA*T15                                                V12 = D*T24 - L*T25 + T*T26 - AB*T27                                          V13 = C*T0 - I*T1 + O*T2 - U*T3 + AA*T4 - AE*T5 + Y*T6                              - S*T7 + M*T8 - G*T9 + A*T10 + E*T11 - I*T11 - K*T12                          + Q*T13 - W*T14 + AC*T15                                                V14 = B*T16 - F*T17 + J*T18 - N*T19 + R*T20 - V*T21                                 + Z*T22 - AD*T23                                                        V15 = A*T0 - C*T1 + E*T2 - G*T3 + I*T4 - K*T5 + M*T6                                - 0T87 + Q*T8 - S*T9 + U*T10 - W*T11 + Y*T12                                  - AA*T13 + AC*T14 - AE*T15                                              V16 = 0                                                                       V17 = -V15                                                                    V18 = -V14                                                                    V19 = -V13                                                                    V20 = -V12                                                                    V21 = -V11                                                                    V22 = -V10                                                                    V23 = -V9                                                                     V24 = -V8                                                                     V25 = -V7                                                                     V26 = -V6                                                                     V27 = -V8                                                                     V28 = -V7                                                                     V29 = -V3                                                                     V30 = -V2                                                                     V31 = -V1                                                                     V32 = -V0                                                                     V33 = -Q*T0 + M*T1 + U*T2 - I*T3 - Y*T4 + E*T5 + AC*T6                              - A*T7 - AE*T8 - C*T9 + AA*T10 + G*T11 - W*T12                                - K*T13 + S*T14 + O*T15                                                 V34 = -R*T16 + J*T17 + Z*T18 - B*T19 - AD*T20 - F*T21                               + V*T22 + N*T23                                                         V35 = -S*T0 + G*T1 + AE*T2 + E*T3 - U*T4 - Q*T5 + I*T6                              + AC*T7 + C*T8 - W*T9 - O*T10 + K*T11 + AA*T12                                + A*T13 - Y*T14 - M*T15                                                 V36 = -S*T0 + G*T1 + AE*T2 + E*T3 - U*T4 - Q*T5 + I*T6                              + AC*T7 + C*T8 - W*T9 - O*T10 + K*T11 + A*T12                                 + A*T13 - Y*T14 - M*T15                                                 V37 = -U*T0 + A*T1 + W*T2 + S*T3 - C*T4 - Y*T5 - Q*T6                               + E*T7 + AA*T8 + 0*T9 - G*T10 - AC*T11 - M*T12                                + I*T13 + AE*T14 + K*T15                                                V38 = -V*T16 - B*T17 + R*T18 + Z*T19 + F*T20 - N*T21                                - AD*T22 - J*T23                                                        V39 = -W*T0 - E*T1 + M*T2 + AE*T3 + O*T4 - C*T5 - U*T6                              - Y*T7 - G*T8 +0 K*T9 + AC*T10 + Q*T11 - A*T12                                - S*T13 - AA*T14 - I*T15                                                V40 = -X*T28 - H*T29 + H*T30 + X*T31                                          V41 = -Y*T0 - K*T1 + C*T2 + Q*T3 + AE*T4 + S*T5 + E*T6                              - IT87 - W*T8 - AA*T9 - M*T10 + A*T11 + O*T12                                 + AC*T13 + U*T14 + G*T15                                                V42 = -Z*T16 - N*T17 - B*T18 + J*T19 + V*T20 + AD*T21                               + R*T22 + F*T23                                                         V43 = -AA*T0 - Q*T1 - G*T2 + C*T3 + M*T4 + W*T5 + AE*T6                             + U*T7 + K*T8 + A*T9 - I*T10 - S*T11 - AC*T12                                 - Y*T13 - O*T14 - E*T15                                                 V44 = -AB*T24 - T*T25 - L*T26 - D*T27                                         V45 = -AC*T0 - W*T1 - Q*T2 - KIT3 - E*T4 + A*T5 + G*T6                              + M*T7 + S*T8 + Y*T9 + AE*T10 + AA*T11 + U*T12                                + 0*T13 + I*T14 + C*T15                                                 V46 = -AD*T16 - Z*T17 - V*T18 - R*T19 - N*T20 - J*T21                               - F*T22 - B*T23                                                         V47 = -AE*T0 - AC*T1 - AA*T2 - Y*T3 - W*T4 - U*T5                                   - S*T6 - Q*T7 - O*T8 - M*T9 - K*T10 - I*T11 - G*T12                           - E*T13 - C*T14 - A*T15                                                 V48 = -1T828 - 1*T29 - 1*T30 - 18 T31                                         V49 = V47                                                                     V50 = V46                                                                     V51 = V45                                                                     V52 = V44                                                                     V53 = V43                                                                     V54 = V42                                                                     V55 = V41                                                                     V56 = V40                                                                     V57 = V39                                                                     V58 = V38                                                                     V59 = V37                                                                     V60 = V36                                                                     V61 = V35                                                                     V62 = V34                                                                     V63 = V33                                                                     ______________________________________                                         V17 through 48 are stored in PMEM in reverse order.                           ##SPC1##

I claim:
 1. An integrated audio/video decoder comprising:an internalmemory; means for alternately writing a block of audio data to theinternal memory then writing a block of video data to the internalmemory; and a signal processing unit which alternately decodes audiodata from the internal memory then decodes video data from the internalmemory, wherein: the internal memory comprises a first memory unit, asecond memory unit, a third memory unit, and a fourth memory unit, allconnected to the signal processing unit; when decoding audio data, thefirst memory unit contains components of encoded frequency domain soundsamples, the second memory unit contains data used to decode subbandaudio data, the third memory unit contains components of the time domainaudio vectors, and the fourth memory unit contains (a) decodedcomponents of frequency domain vectors of sound samples, (b) anaccumulation of time-domain vectors of sound samples, or (c) soundamplitude values; and when decoding video data, the first memory unitcontains data used to dequantize DCT coefficients, the second memoryunit contains quantized DCT coefficients, the third memory unit containserror terms, and the fourth memory unit contains intermediate values ofthe quantized DCT coefficients.
 2. The audio/video decoder of claim 1,wherein the means for alternately writing further comprises an errorcode injector, which injects error codes into the audio data when anerror is detected.
 3. An integrated audio/video decoder comprising:aninternal memory; means for alternately writing a block of audio data tothe internal memory then writing a block of video data to the internalmemory; and a signal processing unit that alternately decodes audio datafrom the internal memory then decodes video data from the internalmemory, wherein the signal processing unit comprises: a multiplier whichmultiplies IDCT coefficients and dequantization coefficients duringvideo decoding and multiplies components of quantized sample vectors anddequantization coefficients during audio decoding; and a butterfly unitwhich determines sums and differences of IDCT coefficients for aninverse discrete cosine transformation during video decoding anddetermines sums and differences of components of a frequency-domainsample vector during audio decoding; a first multiplexer having anoutput terminal coupled to a first input terminal of the multiplier; asecond multiplexer having an output terminal coupled to a second inputterminal of the multiplier; a third multiplexer having a first inputterminal coupled to the output terminal of the multiplier and an outputterminal coupled to a first input terminal of the butterfly unit; and afourth multiplexer having an output terminal coupled to a second inputterminal of the butterfly unit.
 4. The audio video decoder of claim 3,wherein the internal memory comprises:a first memory unit coupled toprovide a data signal to an input terminal of the first multiplexer; asecond memory unit coupled to provide a data signal to an input terminalof the second multiplexer; a third memory unit coupled to provide a datasignal to a second input terminal of the third multiplexer; and a fourthmemory unit coupled to provide a data signal to an input terminal of thefourth multiplexer, wherein:when decoding audio data, the first memoryunit contains components of encoded frequency domain sound samples, thesecond memory unit contains data used to decode subband audio data, thethird memory unit contains components of the time domain audio vectors,and the fourth memory unit contains (a) decoded components of frequencydomain vectors of sound samples, (b) an accumulation of time-domainvectors of sound samples, or (c) sound amplitude values; and whendecoding video data, the first memory unit contains quantized DCTcoefficients, the second memory unit contains data used to dequantizeDCT coefficients, the third memory unit contains error terms, and thefourth memory unit contains intermediate values of the quantized DCTcoefficients.
 5. The audio/video decoder of claim 3, wherein the signalprocessing unit further comprises a fifth multiplexer having inputterminals and an output terminal, wherein a first input terminal iscoupled to a first output terminal of the butterfly unit and a secondinput terminal is coupled to a second output terminal of the butterflyunit, and further wherein the output terminal is coupled to both anaudio clamp and a video clamp.